﻿function ajax(data, mothed, success) {
 
    $.ajax({
        type: "POST",
        data: data,
        contentType: "application/json",
        url: asmxPage+"/" + mothed,
        cache: false,
        async: false,
        success: success
    });
}

function _setDivScrollTop() {
    $("#br")[0].scrollTop = $("#br")[0].scrollHeight;
}
function _tsend() {
    var html = editor.EditorDocument.body.innerHTML;
 
    __send(html);
    editor.EditorDocument.body.innerHTML = "";
}
$(function() {
    $("#send").click(function() {
       
        _tsend();
    });
    $("#clear").click(function() {
        editor.EditorDocument.body.innerHTML = "";
    });


});
var editor = null;
function FCKeditor_OnComplete(editorInstance) {
    editor = FCKeditorAPI.GetInstance("FCKeditor1");
    if (document.all) // IE
        editorInstance.EditorDocument.attachEvent("onkeydown", __onkeypress);
    else// other browser
        editorInstance.EditorDocument.addEventListener('onkeydown', __onkeypress, true);

}
function __onkeypress(e) {
    var keycode = e.keyCode;
    if ((keycode == 13 && $("#qjj1:checked").length > 0) ||
                                ((e.ctrlKey) && (e.keyCode == 83) && $("#qjj2:checked").length > 0) ||
                                ((e.ctrlKey) && (e.keyCode == 13) && $("#qjj3:checked").length > 0)) {
        _tsend();
    }
}